package com.example.loglib;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by huangbei on 2017/8/28.
 */

//配置log,单例模式
public class Config {

    private  String myTag = "myLog";

    private boolean isShowE = true;

    private boolean isShowI = true;

    private boolean isShowW = true;

    private boolean isShow = true;

    private boolean isShowTime = true;

    private Map<String,String> notShowTagList;//不显示的tag

    private static Config instance;

    private Config(){
        notShowTagList = new HashMap<String,String>();
    }

    public static Config getInstance(){
        if(instance == null){
            synchronized(Config.class){
                if(instance == null){
                    instance = new Config();
                }
            }
        }
        return instance;
    }

    public String getMyTag() {
        return myTag;
    }

    public void setMyTag(String myTag) {
        this.myTag = myTag;
    }

    public boolean isShowE() {
        return isShowE;
    }

    public void setShowE(boolean showE) {
        isShowE = showE;
    }

    public boolean isShowI() {
        return isShowI;
    }

    public void setShowI(boolean showI) {
        isShowI = showI;
    }

    public boolean isShowW() {
        return isShowW;
    }

    public void setShowW(boolean showW) {
        isShowW = showW;
    }

    public boolean isShow() {
        return isShow;
    }

    public void setShow(boolean show) {
        isShow = show;
    }

    public boolean isShowTime() {
        return isShowTime;
    }

    public void setShowTime(boolean showTime) {
        isShowTime = showTime;
    }

    //是否显示这个tag
    public boolean isShowThisTag(String tag){
        if(notShowTagList.get(tag)!=null){
            return false;
        }else{
            return true;
        }
    }

    public void addNotShowTag(String tag){
        notShowTagList.put(tag,tag);
    }

    public void removeNotShowTag(String tag){
        notShowTagList.remove(tag);
    }
}
